package com.changgou.search.listener;

import com.changgou.search.service.EsManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "search_delete_queue")
public class SkuSearchDeleteListener {

    @Autowired
    private EsManagerService esManagerService;

    @RabbitListener(queues = "search_delete_queue")
    public void searchDelete(String spuId) {
        System.out.println("删除索引库监听类,接收到的spuId: " + spuId);
        //调用业务层完成索引库数据删除
        esManagerService.delSkuListBySpuId(spuId);
    }


}